#!/bin/bash
# 安装依赖脚本

SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
PROJECT_DIR="$(dirname "$SCRIPT_DIR")"

cd "$PROJECT_DIR"

echo "=================================="
echo "安装 SkyWalking 数据采集系统依赖"
echo "=================================="
echo ""
echo "项目目录: $PROJECT_DIR"
echo ""

# 检查是否在 conda 环境中
if [ -n "$CONDA_DEFAULT_ENV" ]; then
    echo "✓ 检测到 Conda 环境: $CONDA_DEFAULT_ENV"
else
    echo "⚠️  未检测到 Conda 环境"
fi

# 升级 pip
echo ""
echo "1. 升级 pip..."
pip install --upgrade pip

# 安装依赖
echo ""
echo "2. 安装依赖包..."
pip install -r requirements.txt

# 验证安装
echo ""
echo "3. 验证安装..."
python3 scripts/verify_setup.py

echo ""
echo "=================================="
echo "✓ 安装完成"
echo "=================================="

